#ifndef __LGUIHSLIDER_H__
#define __LGUIHSLIDER_H__

#include "LGUIWindow.h"

class LGUIHSlider : public LGUIWindow  
{
  int value, minValue, maxValue, radius;
  int knobSize;
  bool dragging;

  void clamp()
  {
    if (value<minValue) value=minValue;
    if (value>maxValue) value=maxValue;
  }
  short16 knobColor;
public:
  LGUIHSlider(int id, int _x, int _y, int _w, int _h, int _value, int _min, int _max, int _userdata=-1, short16 knobColor=COLOR(0xe0e0f0));
  virtual ~LGUIHSlider();
  
  void draw(int xoff, int yoff);
  void penDown(int px, int py);
  void penMove(int px, int py, bool pressed);
  void penUp(int px, int py);
  
  void setValue(int v)
  {
    value=v;
    clamp();
  }
  
};


#endif //__LGUIHSLIDER_H__